package org.chunchu.todo;

import android.util.Log;

public class LogUtils {
	public static final String LOG_TAG = "chunchu";
	public static final String SPACE = " ";

	public static void i(Object... values) {
		Log.i(LOG_TAG, buildString(values));
	}

	public static void d(Object... values) {
		Log.d(LOG_TAG, buildString(values));
	}

	public static void w(Object... values) {
		Log.w(LOG_TAG, buildString(values));
	}

	public static void e(Object... values) {
		Log.e(LOG_TAG, buildString(values));
	}

	public static void i(Throwable ex, Object... values) {
		Log.i(LOG_TAG, buildString(values), ex);
	}

	public static void d(Throwable ex, Object... values) {
		Log.d(LOG_TAG, buildString(values), ex);
	}

	public static void w(Throwable ex, Object... values) {
		Log.w(LOG_TAG, buildString(values), ex);
	}

	public static void e(Throwable ex, Object... values) {
		Log.e(LOG_TAG, buildString(values), ex);
	}

	private static String buildString(Object... values) {
		StringBuilder builder = new StringBuilder();
		for (Object v : values) {
			builder.append(v).append(SPACE);
		}
		return builder.toString();
	}
}
